﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MobaCommon.Config
{
    /// <summary>
    /// 英雄数据
    /// </summary>
    public class HeroData
    {
        private static Dictionary<int, HeroDataModel> idModelDic = new Dictionary<int, HeroDataModel>();
        static HeroData()
        {
            CreateHero(1,"Aatrox",60,20,300,100,10,3,50,10,1,new int[] { 1001,1002,1003,1004});
            CreateHero(2, "Ashe", 50, 10, 200, 80, 15, 2, 30, 5, 5, new int[] { 2001, 2002,2003, 2004 });
        }
        public static HeroDataModel GetModel(int heroId)
        {
            if (!idModelDic.ContainsKey(heroId))
                return null;
            return idModelDic[heroId];
        }
        /// <summary>
        /// 创建英雄
        /// </summary>
        /// <returns></returns>
        private static void CreateHero(int id, string heroName, int baseAttack, int baseDefense, int hp, int mp, int growAttack, int growDefens, int growHp, int growMp, double attackDistance, int[] skillIds)
        {
            HeroDataModel hero = new HeroDataModel(id,heroName,baseAttack,baseDefense,hp,mp,growAttack,growDefens,growHp,growMp,attackDistance,skillIds);
            idModelDic.Add(hero.id,hero);
        }

    }
    /// <summary>
    /// 英雄数据模型
    /// </summary>
    public class HeroDataModel
    {
        //英雄编号
        public int id;

        public string heroName;
        /// <summary>
        /// 基础攻击力
        /// </summary>
        public int baseAttack;
        /// <summary>
        /// 基础防御力
        /// </summary>
        public int baseDefens;
        /// <summary>
        /// 成长攻击力
        /// </summary>
        public int growAttack;
        /// <summary>
        /// 成长防御力
        /// </summary>
        public int growDefens;
        /// <summary>
        /// 生命值
        /// </summary>
        public int hp;
        /// <summary>
        /// 成长生命值
        /// </summary>
        public int growHp;
        /// <summary>
        /// 魔法值
        /// </summary>
        public int mp;
        /// <summary>
        /// 成长魔法
        /// </summary>
        public int growMp;
        /// <summary>
        /// 攻击距离
        /// </summary>
        public double attackDistance;
        /// <summary>
        /// 技能ID
        /// </summary>
        public int[] skillId;
        public HeroDataModel()
        {

        }
        public HeroDataModel(int id,string heroName,int baseAttack,int baseDefense,int hp,int mp,int growAttack,int growDefens,int growHp,int growMp,double attackDistance,int[] skillIds)
        {
            this.id = id;
            this.heroName = heroName;
            this.baseAttack = baseAttack;
            this.baseDefens = baseDefense;
            this.hp = hp;
            this.mp = mp;
            this.growAttack = growAttack;
            this.growDefens = growDefens;
            this.growHp = growHp;
            this.growMp = growMp;
            this.skillId = skillIds;
            this.attackDistance = attackDistance;
        }
    }
}
